package com.library.hibernatejpa.dao;

import java.util.Collection;
import java.util.List;

import com.library.hibernatejpa.entity.Author;
import com.library.hibernatejpa.entity.Book;
import com.library.hibernatejpa.entity.Publisher;

public interface LibraryDAO
{
  public Collection<Author> getAuthors();

  /**
   * Get a Artist Object given the id
   * @param id
   */
  public Author getAuthorById(Integer id);

  /**
   * Save an Artist Object
   */
  public Author saveAuthor(Author author);

  /**
   * Get a Record given the id
   * @param id
   */
  public Publisher getPublisherById(Integer id);

  /**
   * Save a record
   * @param record
   */
  public Publisher savePublisher(Publisher record);

  /**
   * Save a book
   * @param book
   */
  public Book saveBook(Book book);
  
  /**
   * Get a Track given the id
   * @param id
   * @return
   */
  public Book getBookById(Integer id);

  /**
   * Search records given the title of the record
   * @param title
   */
  public List<Publisher> searchPublishersByTitle(String name);
  
  /**
   * Search books given the id of a Publisher
   * @param title
   */
  public List<Book> searchBooksByPublisher(Integer id);
  
}
